package com.yanqu.road.exception;

import java.util.List;

public class BusinessException extends Exception {
    private int code;
    private String msg;
    private List<String> msgParams;

    public BusinessException(int code) {
        super("err code " + code);
        this.code = code;
        this.msg = String.valueOf(code);
    }

    public BusinessException(int code, String msg, List<String> msgParams) {
        this.code = code;
        this.msg = msg;
        this.msgParams = msgParams;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public List<String> getMsgParams() {
        return msgParams;
    }

    @Override
    public synchronized Throwable fillInStackTrace() {
        return this;
    }

    public static BusinessException newException(int code) {
        return new BusinessException(code);
    }


}
